package com.zqx.facade.childsystem;

import lombok.extern.slf4j.Slf4j;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * description: 子系统类
 * @author zqx
 * @date 2018/09/04
 */
@Slf4j
public class FileWriter {

    public void write(String encryptStr,String fileNameDes)
    {
        System.out.println("保存密文，写入文件");
        try {
            FileOutputStream fileOutputStream = new FileOutputStream(fileNameDes);
            fileOutputStream.write(encryptStr.getBytes());
            fileOutputStream.close();
        } catch (FileNotFoundException e) {
            System.out.println("文件不存在");
            e.printStackTrace();
        } catch (IOException e) {
            System.out.println("文件操作错误");
            e.printStackTrace();
        }


    }
}
